<include file="Public:header" />
<!-- nice-scroll -->
<script src="__PUBLIC__/style/js/plugins/nice-scroll/jquery.nicescroll.min.js" type="text/javascript"></script>
<script type="text/javascript" src="__PUBLIC__/style/js/TableFreeze.js"></script>
<script src="__PUBLIC__/js/mxcrm_more.js" type="text/javascript"></script>
<!-- daterangepicker -->
<link href="__PUBLIC__/css/daterangepicker.css" rel="stylesheet">
<script src="__PUBLIC__/js/daterangepicker/daterangepicker.js"></script>
<style>
body{
	overflow-y: hidden;
}
.option{padding-left:-30px;}

</style>
<script>
$(function(){
	var scroll_width = 10;
	$("#table_div").height(window.innerHeight-$("#table_div").offset().top-$("#tfoot_div").height()-parseInt($("#table_container").css("padding-bottom").replace("px",""))-10);
	$(window).resize(function(){
		$("#table_div").height(window.innerHeight-$("#table_div").offset().top-$("#tfoot_div").height()-parseInt($("#table_container").css("padding-bottom").replace("px",""))-10);
		$("#oDivL_tab_Test3").height($("#table_div").height()-scroll_width-1).width($("#oTableLH_tab_Test3").width());
		$("#oDivH_tab_Test3").height($("#oTableLH_tab_Test3").height()).width($("#table_div").width()-scroll_width);
	})
	$(".nicescroll").niceScroll({
		cursorcolor: "#999",//#CC0071 光标颜色
	    cursoropacitymax: 0.4, //改变不透明度非常光标处于活动状态（scrollabar“可见”状态），范围从1到0
	    touchbehavior: false, //使光标拖动滚动像在台式电脑触摸设备
	    cursorwidth: scroll_width+"px", //像素光标的宽度
	    cursorborder: "0", //     游标边框css定义
	    cursorborderradius: "3px",//以像素为光标边界半径
	    autohidemode: false, //是否隐藏滚动条
	    zindex:100,
	    background:"#F3F3F5",//滚动条背景色
	});
	$("#tab_Test3").FrozenTable(1,0,2);
	$("#oDivL_tab_Test3").height($("#table_div").height()-scroll_width).width($("#oTableLH_tab_Test3").width()).css({'zIndex':9});
	$("#oDivH_tab_Test3").height($("#oTableLH_tab_Test3").height()).width($("#table_div").width()-scroll_width).css({'zIndex':9});
})
</script>
<div class="wrapper wrapper-content">
	<include file="Public:alert" />
    <div class="row">
        <div class="col-md-12">
            <div class="ibox float-e-margins">
				<div class="title-bar" style="position: relative;z-index: 99;">
					<div class="row clearfix" id="title-hide" style="display:none;">
						<ul class="breadcrum pull-left">
							<li>已选中&nbsp;<span id="icheck_num"></span>&nbsp;项</li>
							<li><a href="javascript:void(0)" id="edit_finance"><i class="fa fa-download"></i>&nbsp;导出</a></li>
							<li class="last_li"><big><a class="fa fa-times pull-right" id="back-show"></a></big></li>
						</ul>
					</div>
                    <include file="Public:alert" />
                    <form id="" class="form-group" method="get" style="margin-bottom: 0px;">
						<input type="hidden" name="m" value="finance">
						<input type="hidden" name="a" value="index">
					<div class="row " id="title-show">
						<!--<ul class="nav pull-left" style="margin:2px 0 0 15px;">-->
							<!--<a href="{:U('finance/add','t=receivables')}" class="btn btn-primary btn-sm pull-left" style="margin-right:8px"><i class="fa fa-plus-circle"></i>&nbsp; 添加应收款</a>-->
						<!--</ul>-->
                        <div class="col-lg-12" style="float: right !important;">
                            <ul class="nav col-lg-3 col-lg-offset-2 " style="display: inline-block;">
                                <li>
                                    <div class="input-group" style="width:100%;">
                                        <input type="text" name="between_date" id="reservation" class="form-control" />
                                        <i class="glyphicon glyphicon-calendar fa fa-calendar" style="position: absolute;bottom: 10px;right: 24px;top: auto;cursor: pointer;"></i>
                                    </div>
                                </li>
                            </ul>
                            <div class="nav  col-lg-2" style="margin:2px 0 0 0px;display: inline-block;">
                                <div class="input-group">
                                    <select class="form-control input-sm select2" style="min-width:165px;width: 100%;height: 0px;" name="department" id="department" onchange="changeRole()">
                                        <option class="all" value="all">{:L('ALL')}</option>
                                        <volist name="departmentList" id="vo">
                                            <option value="{$vo.department_id}">{$vo.name}</option>
                                        </volist>
                                    </select>
                                </div>
                            </div>
                            <div class="nav col-lg-2" style="margin:2px 0 0 0px;display: inline-block;">
                                <div class="input-group">
                                    <select class="form-control input-sm select2" style="min-width:165px;width: 100%;height: 0px;" name="role" id="role" onchange="changeCondition()">
                                        <option class="all" value="all">{:L('ALL')}</option>
                                        <volist name="roleList" id="vo">
                                            <option value="{$vo.role_id}" <if condition="$_GET['role'] eq $vo['role_id']">selected</if>>{$vo.role_name}-{$vo.user_name}</option>
                                        </volist>
                                    </select>
                                </div>
                            </div>
                            <div class="col-lg-2" style="margin-left: 20px;display: inline-block;vertical-align: bottom;">
                                <button type="submit" id="analytics_search" class="btn btn-primary">立即搜索</button>
                                <a title="高级搜索" href="javascript:void(0)" id="search_type" class="btn btn-white btn-bitbucket" style="display: inline-block;margin-left: 20px;display: none;"><i class="fa fa-filter" style="color: #D8E3EF;"></i></a>
                                <div class="dropdown input-group btn-group" style="display: none;float: right;">
                                    <a title="排序" href="javascript:void(0)" data-toggle="dropdown" class="btn btn-white btn-bitbucket dropdown-toggle" style="margin-left:-4px;"><i class="fa fa-sort-amount-asc" style="color: #D8E3EF;"></i></a>
                                    <ul class="dropdown-menu dropdown-menu-left" style="width:150px;left:-100px;" id='dropdown_order'>
                                        <li class="list-group" role="presentation" >
                                            <div class="full-height-scroll"  data-plugin="slimScroll" style="overflow: hidden; width: auto;margin-top:10px;" >
                                                <div class="link-block" style="margin-left:15px;">
                                                    <div class="radio radio-info radio-inline">
                                                        <input type="radio" class="save_order" name="order_field" id="create_time_order" value="create_time" <if condition = "$_GET['order_field'] eq 'create_time'">checked</if> >
                                                        <label for="create_time_order">
                                                            创建时间
                                                        </label>
                                                    </div>
                                                </div>
                                                <div class="link-block" style="margin-left:15px;">
                                                    <div class="radio radio-info radio-inline">
                                                        <input type="radio" class="save_order" name="order_field" id="update_time_order" value="update_time" <if condition = "$_GET['order_field'] eq 'update_time' || $_GET['order_field'] eq ''">checked</if>>
                                                        <label for="update_time_order">
                                                            修改时间
                                                        </label>
                                                    </div>
                                                </div>
                                                <volist name="order_fields" id="vo">
                                                    <div class="link-block" style="margin-left:15px;">
                                                        <div class="radio radio-info radio-inline">
                                                            <input type="radio" class="save_order" name="order_field" id="{$vo['field']}_order" value="{$vo['field']}" <if condition = "$_GET['order_field'] eq $vo['field']">checked</if>>
                                                            <label for="{$vo['field']}_order">
                                                                {$vo['name']}
                                                            </label>
                                                        </div>
                                                    </div>
                                                </volist>
                                            </div>
                                        </li>
                                        <li class="divider" style="height:1px;"></li>
                                        <li>
                                            <div class="link-block" style="margin-left:15px;">
                                                <div class="radio radio-info radio-inline">
                                                    <input type="radio" class="save_order" name="order_type" id="asc_order" value="asc" <if condition = "$_GET['order_type'] eq 'asc'">checked</if>>
                                                    <label for="asc_order">
                                                        正序
                                                    </label>
                                                </div>
                                            </div>
                                            <div class="link-block" style="margin-left:15px;">
                                                <div class="radio radio-info radio-inline">
                                                    <input type="radio" class="save_order" name="order_type" id="desc_order" value="desc" <if condition = "$_GET['order_type'] eq 'desc' || $_GET['order_type'] eq ''">checked</if>>
                                                    <label for="desc_order">
                                                        倒序
                                                    </label>
                                                </div>
                                            </div>
                                            <div class="link-block" style="margin-left:15px;">
                                                <div class="radio radio-info radio-inline">
                                                    <input type="radio" class="save_order" name="order_type" id="cancel_order" value="cancel_order" >
                                                    <label for="cancel_order">
                                                        取消排序
                                                    </label>
                                                </div>
                                            </div>
                                        </li>
                                    </ul>
                                </div>
                            </div>

                        </div>

					</div>
                    </form>
				</div>
				<div class="row" style="margin: 0">
					<div class="ibox-content" style="padding:0px;border:none;">
						<div class="ibox-content clearfix" id="table_container" style="padding:0px;">
							<form id="form1" action="" method="Post" style="position:relative;">
								<div id="table_div" class="nicescroll" style="left:0px;top:0px;">
									<table class="table table-hover table-striped table_thead_fixed" id="tab_Test3" style="background:#fff;margin-bottom:0px;">
										<if condition="$list eq null">
											<div style="background-color:#fff;"><include file="Public:nodata" /></div>
										<else/>
											<tr id="childNodes_num" class="tabTh">
												<td style="max-width: 60px;width:74px;padding:0 10px 0 7px;">
													<div class="checkbox checkbox-primary">
														<input type="checkbox" class="check_all"/>
														<label for=""></label>
													</div>
												</td>
												<td>猎头顾问</td>
												<td>部门</td>
												<td>分配到业绩</td>
												<!--<td>分配到提成</td>-->
												<td>发票角色</td>
												<td>客户名称</td>
												<td>项目名称</td>
												<td>候选人</td>
                                                <td>
                                                    <if condition="$_GET['desc_order'] == 'create_time'">
                                                    <a href="{:U('finance/index','asc_order=create_time&'.$parameter)}" title="点击按时间正序排列">
                                                        到账日期&nbsp;<span class="fa fa-caret-down"></span>
                                                    </a>
                                                    <elseif condition="$_GET['asc_order'] == 'create_time'"/>
                                                    <a href="{:U('finance/index','desc_order=create_time&'.$parameter)}"  title="点击按时间倒序排列">
                                                        到账日期&nbsp;<span class="fa fa-caret-up"></span>
                                                    </a>
                                                    <else/>
                                                    <a href="{:U('finance/index','asc_order=create_time&'.$parameter)}" title="点击按时间正序排列">到账日期&nbsp;<span class="fa fa-caret-down"></a>
                                                </if>
                                                </td>
											</tr>
											<volist name="list" id="vo">
												<tr class="controls_tr">
													<td>
														<div class="checkbox checkbox-primary">
															<input name="receivables_id[]" class="check_list" type="checkbox" value="{$vo.receivables_id}"/>
															<label for=""></label>
														</div>
													</td>
													<td><a href="#">{$vo.user_name}</a></td>
													<td>{$vo.department_name}</td>
													<td class="project-completion">{$vo.integral}</td>
													<!--<td>1000</td>-->
													<td>{$vo.tikect_type}</td>
													<td><a href="{:U('customer/view', 'id='.$vo['customer_id'])}">{$vo.customer_name}</a></td>
													<td>
                                                        <a href="{:U('business/view','id='.$vo['business_id'])}">{$vo.project_name}</a>
													</td>
													<td><a  href="{:U('product/view', 'id='.$vo['eid'])}">{$vo.resume_name}</a></td>
													<td>{$vo.addtime|date='Y-m-d H:i:s',###}</td>
												</tr>
											</volist>
										</if>
									</table>
								</div>
								<div id="tfoot_div" class="clearfix">
									<tr>
										<div class="clearfix" id="tfoot_page">
											{$page}<include file="Public:listrows" />
										</div>
									</tr>
								</div>
								<!--<div id="tfoot_div" class="clearfix">-->
									<!--<div class="clearfix" id="tfoot_page">-->
										<!--<span class="pull-left" style="margin-left:25px;margin-top:10px;padding-top:8px;">-->
											<!--总计应收:&nbsp;<span style="color:green">{$money_arr['sum_money']}&nbsp;元</span>&nbsp;&nbsp;总计已收:&nbsp;<span style="color:green">{$money_arr['all_ysmoney']}&nbsp;元</span>&nbsp;&nbsp;总计未收:&nbsp;<span style="color:green">{$money_arr['all_unmoney']}&nbsp;元</span>-->
										<!--</span>-->
										<!--<if condition="$fields_search">-->
											<!--<span class="pull-left" style="margin-left:10px;margin-top:10px;">本次搜索结果<span style="color:#F8AC59"> {$count} </span>条数据<a href="{:U('finance/index','t=receivables')}" class="btn" style="background:#fff;border:1px solid #ccc;margin-left:10px;color:#999;" id="clearnumber">清除搜索条件</a></span>-->
										<!--</if>-->
										<!--{$page}<include file="Public:listrows" />-->
									<!--</div>-->
								<!--</div>-->
							</form>
						</div>
					</div>
				</div>
    		</div>
        </div>
    </div>
</div>
<div style="display:none" id="dialog-field-search" title="高级搜索">
	<form class="form-inline" id="searchForm" action="" method="get">
		<div id="search_add" style="width:650px;float:left;">
		<empty name="fields_search">
			<div id="con_search_1" style="float:left;width:650px;margin:0 10px 0 10px;">
				<ul class="nav pull-left" style="margin:0px 0 0 23px;width:650px">
					<li class="pull-left">
						<select id="field_1" style="width:auto" class="form-control input-sm field_name new-select" onchange="changeCondition(1)" >
							<option class="" value="name">--请选择条件--</option>
							<option class="word" value="name">应收款编号</option>
							<option class="word" value="customer_name">{:L('CUSTOMER')}名称</option>
							<option class="word" value="contract_name">合同编号</option>
							<option class="number" value="price">{:L('AMOUNT OF RECEIVING')}</option>
							<option class="date" value="pay_time">应收款时间</option>
							<option class="receivables_status" value="status">{:L('STATUS')}</option>
							<option class="role" value="owner_role_id">{:L('OWNER_ROLE')}</option>
							<option class="role" value="creator_role_id">{:L('CREATOR_ROLE')}</option>
							<option class="date" value="create_time">{:L('CREATE_TIME')}</option>
							<option class="date" value="update_time">{:L('UPDATE_TIME')}</option>
						</select>&nbsp;&nbsp;
					</li>
					<li class="pull-left" id="conditionContent_1">
						<select id="condition_1" style="width:auto" class="form-control input-sm new-select" onchange="changeSearch()" name="name[condition]">
							<option value="contains">{:L('CONTAINS')}</option>
							<option value="is">{:L('IS')}</option>
							<option value="start_with">{:L('START_WITH')}</option>
							<option value="end_with">{:L('END_WITH')}</option>
							<option value="is_empty">{:L('IS_EMPTY')}</option>
						</select>&nbsp;&nbsp;
					</li>
					<li class="pull-left" id="searchContent_1">
						<input id="search_1" type="text" style="width:160px;" class="input-medium form-control input-sm search-query" name="name[value]"/>&nbsp;&nbsp;
					</li>
				</ul>
			</div>
			<?php $max_key = 1;?>
		</empty>
		</div>
		<input type="hidden" name="content" <if condition="$_GET['content']">value="resource"</if> />
		<input type="hidden" name="this_page" value="{$this_page}" />
		<div class="clearfix"></div>
		<div style="margin-left: 35px;margin-top:10px;"><a href="javascript:void(0);" style="display: -moz-stack;margin: 30px 0px 0px; font-size: 12px; color: rgb(62, 133, 233);" id="add_btn">+添加筛选条件</a>
		</div>
		<div class="pull-right" class="button_type" style="margin:20px;">
			<input type="hidden" name="m" value="finance"/>
			<input type="hidden" name="a" value="index"/>
			<input type="hidden" name="t" value="receivables"/>
			<input type="hidden" name="act" id="act" value="index"/>
			<if condition="$Think.get.by neq null">
				<input type="hidden" name="by" value="{$Think.get.by}"/>
			</if>
		</div>
	</form>
</div>
<div style="display:none;" id="dialog-role-info" title="{:L('DIALOG_USER_INFO')}">
	<div class="spiner-example">
        <div class="sk-spinner sk-spinner-three-bounce">
            <div class="sk-bounce1"></div>
            <div class="sk-bounce2"></div>
            <div class="sk-bounce3"></div>
        </div>
    </div>
</div>
<div style="display:none;" id="dialog-receivingorder" title="添加回款单">
	<div class="spiner-example">
        <div class="sk-spinner sk-spinner-three-bounce">
            <div class="sk-bounce1"></div>
            <div class="sk-bounce2"></div>
            <div class="sk-bounce3"></div>
        </div>
    </div>
</div>
<script type="text/javascript">
$('[data-toggle="tooltip"]').tooltip({html:true});
/*让复选框默认取消选择*/
$(':checkbox').prop('checked', false);

$(".add_receivingorder").click(function(){
	var receivingorder_id = $(this).attr('rel');
	$('#dialog-receivingorder').dialog('open');
	$('#dialog-receivingorder').load('{:U("finance/adddialog","t=receivingorder&id=")}'+receivingorder_id);
});

//时间插件
$('#reservation').daterangepicker({
    startDate: '{$start_date}',
    endDate: '{$end_date}',
    //minDate: '01/01/2012',    //最小时间
    maxDate : moment(), //最大时间
    showDropdowns : true,
    showWeekNumbers : false, //是否显示第几周
    // timePicker : true, //是否显示小时和分钟
    // timePickerIncrement : 60, //时间的增量，单位为分钟
    timePicker12Hour : false, //是否使用12小时制来显示时间
    ranges : {
        //'最近1小时': [moment().subtract('hours',1), moment()],
        '今日': [moment().startOf('day'), moment()],
        '昨日': [moment().subtract('days', 1).startOf('day'), moment().subtract('days', 1).endOf('day')],
        '上月': [moment().subtract('days', '{$daterange[0][start_day]}'), moment().subtract('days', '{$daterange[0][end_day]}')],
        '本月': [moment().subtract('days', '{$daterange[1][start_day]}'), moment()],
        '上季度': [moment().subtract('days', '{$daterange[2][start_day]}'), moment().subtract('days', '{$daterange[2][end_day]}')],
        '本季度': [moment().subtract('days', '{$daterange[3][start_day]}'), moment()],
        '上一年': [moment().subtract('days', '{$daterange[4][start_day]}'), moment().subtract('days', '{$daterange[4][end_day]}')],
        '本年': [moment().subtract('days', '{$daterange[5][start_day]}'), moment()],
        // '最近7日': [moment().subtract('days', 6), moment()],
        // '最近30日': [moment().subtract('days', 29), moment()]
    },
    opens : 'right', //日期选择框的弹出位置
    buttonClasses : [ 'btn btn-default' ],
    applyClass : 'btn-small btn-primary blue',
    cancelClass : 'btn-small',
    separator : ' to ',
    locale : {
        applyLabel : '确定',
        cancelLabel : '取消',
        fromLabel : '起始时间',
        toLabel : '结束时间',
        customRangeLabel : '自定义',
        daysOfWeek : [ '日', '一', '二', '三', '四', '五', '六' ],
        monthNames: ["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],
        firstDay : 1 ,
        format : 'YYYY-MM-DD', //控件中from和to 显示的日期格式
    },
    "alwaysShowCalendars": true,
    function(start, end, label) {
        //回调
        $('#reservation').val(start.format('YYYY-MM-DD HH:mm:ss') + ' - ' + end.format('YYYY-MM-DD HH:mm:ss'))
        // console.log("New date range selected: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD') + ' (predefined range: ' + label + ')");
    }
});

$("#dialog-receivingorder").dialog({
	autoOpen: false,
	modal: true,
	width: 500,
	maxHeight: 600,
	position: ["center",100],
	buttons: {
		"确定": function () {
			$('#receivingorder_dialog').submit();
			$(this).dialog("close");
		},
		"取消": function () {
			$(this).dialog("close");
		}
	},
	close: function() {
    	$(this).html('');
    }
});

$("#edit_finance").click(function(){
	window.location.href="{:U('finance/edit', 't=receivables&id=')}"+$(this).attr('rel');
});
$("#short_search").val('{$Think.get.search}');

$("#dialog-role-info").dialog({
    autoOpen: false,
    modal: true,
	width: 750,
	maxHeight: 550,
	position: ["center",100]
});
/*添加筛选条件*/
var m = {$max_key};
$('#add_btn').click(function(){
	m += 1;
	$('#search_add').append('<div id="con_search_'+m+'" style="float:left;width:550px;padding-top:10px;margin:0px 10px 0 10px;"><div  id="rem_'+m+'" class="pull-left" style="line-height:30px;"><a href="javascript:void(0);" class="rem_search" rel="'+m+'" title="移除"><span class="fa fa-times-circle"></span></a></div>&nbsp;<ul class="nav pull-left" style="margin:0px 0 0 5px;width:520px"><li class="pull-left"><select id="field_'+m+'"  style="width:auto" class="form-control input-sm field_name new-select" onchange="changeCondition('+m+')" name=""><option class="" value="name">--请选择条件--</option><option class="word" value="name">应收款编号</option><option class="word" value="customer_name">{:L('CUSTOMER')}名称</option><option class="word" value="contract_name">合同编号</option><option class="number" value="price">{:L('AMOUNT OF RECEIVING')}</option><option class="date" value="pay_time">应收款时间</option><option class="receivables_status" value="status">{:L('STATUS')}</option><option class="role" value="owner_role_id">{:L('OWNER_ROLE')}</option><option class="role" value="creator_role_id">{:L('CREATOR_ROLE')}</option><option class="date" value="create_time">{:L('CREATE_TIME')}</option><option class="date" value="update_time">{:L('UPDATE_TIME')}</option></select>&nbsp;&nbsp;</li><li class="pull-left" id="conditionContent_'+m+'"><select id="condition_'+m+'" style="width:auto" class="form-control input-sm new-select" name="condition" onchange="changeSearch()"><option value="contains">{:L('CONTAINS')}</option><option value="is">{:L('IS')}</option><option value="start_with">{:L('START_WITH')}</option><option value="end_with">{:L('END_WITH')}</option><option value="is_empty">{:L('IS_EMPTY')}</option></select>&nbsp;&nbsp;</li><li class="pull-left" id="searchContent_'+m+'"><input id="search_'+m+'" type="text" style="width:160px;" class="input-medium form-control input-sm search-query" name="search"/>&nbsp;&nbsp;</li></ul></div>');
});
$(document).on('click','.rem_search',function(){
	var num = $(this).attr('rel');
	$('#con_search_'+num).remove();
});

// 筛选重复判断
var dosearch = 1;
function doh(){
	var ary = new Array();
	var field_name = '';
	var is_submit = 1;
	$('.field_name').each(function(k, v){
		field_name = $(this).find("option:selected").val();
		if(jQuery.inArray(field_name,ary) >= 0){
			is_submit = 0;
			swal({
				title: "筛选条件中有重复项！",
				text: data.info,
				type: "error"
			});
			dosearch = 0;
			return false;
		}
		ary[k] = field_name;
	})
	if(is_submit == 1){
		$("#searchForm").submit();
	}
}

$("#dialog-field-search").dialog({
	autoOpen: false,
	modal: true,
	width: 700,
	height: 500,
	position: ["center",100],
	buttons: {
		"确定": function () {
			doh();
			if(dosearch == 1){
				$(this).dialog("close");
			}
		},
		"取消": function () {
			$(this).dialog("close");
		}
	}
});
$("#search_type").click(function(){
	$("#dialog-field-search").dialog('open');
})

$(function(){
	$("#check_all").click(function(){
		$("input[class='check_list']").prop('checked', $(this).prop("checked"));
	});
	$('#delete').click(function(){
		var id_array = new Array();
		$("input.check_list:checked").each(function(){
			id_array.push($(this).val());
		});
		if(id_array.length == 0){
			alert_crm('你没有选择任何应收款！');
			return false;
		}
		swal({
			title: "您确定要删除这条信息吗？",
   			text: "删除后将无法恢复，请谨慎操作！",
			type: "warning",
			showCancelButton: true,
			confirmButtonColor: "#DD6B55",
			confirmButtonText: "是的，我要删除！",
	        cancelButtonText:'让我再考虑一下…',
	        closeOnConfirm:false,
	        closeOnCancel:false
		},
		function(isConfirm){
	        if (isConfirm) {
	        	$.ajax({
		            type:'post',
		            url: "{:U('finance/delete','t=receivables')}",
		            data: {receivables_id:id_array},
		            async: false,
		            success: function (data) {
						if (data.status == 1) {
							swal("删除成功！", "您已经永久删除了信息！", "success");
							location.reload();
						}else{
							swal({
								title: "操作失败！",
								text:data.info,
								type: "error"
							})
							return false;
						}
		            },
		            dataType: 'json'
		        });
	        } else {
	            swal("已取消","您取消了删除操作！","error");
	        }
	    });
	});
	$("#dosearch").click(function(){
		result = checkSearchForm();
		if(result){
			$("#act").val('search');$("#searchForm").submit();
		}
	});
	$(".role_info").click(function(){
		$role_id = $(this).attr('rel');
		$('#dialog-role-info').dialog('open');
		$('#dialog-role-info').load('{:U("user/dialoginfo","id=")}'+$role_id);
	});

	$(".dropdown-toggle").click(function () {
        $(this).next().show();
    })
    $(document).click(function(e){
        var _con = $('.dropdown-toggle,.dropdown-menu-left');   // 设置目标区域
        if(!_con.is(e.target) && _con.has(e.target).length === 0){
            $(".dropdown-menu-left").hide();//点击的动作
        };
    });
});
</script>
<include file="Public:footer" />
